﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using 聚欣订单分析.PublicClass;

namespace 聚欣订单分析
{
    public partial class Index : System.Web.UI.Page
    {
        PLSQLClass pl = new PLSQLClass();

        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Session["qx"] == null)
            //{
            //    Response.Redirect("login.aspx");
            //}
            if (!IsPostBack)
            {
                Hkfx();//回款分析
            }
        }

        private void Hkfx()
        {
            //回款分析
           // DataTable dt = pl.SqlBind("select COUNT(*) as zs,SUM(开票金额) as 开票金额,SUM(尾款) as 尾款 from [v_DDB]");
           // double wk = Convert.ToDouble(dt.Rows[0]["尾款"]);
           // double kpje = Convert.ToDouble(dt.Rows[0]["开票金额"].ToString());
           // hfykp.Value = (100 - (wk / kpje) * 100).ToString("0.00");
            //lblWk.Text = dt.Rows[0]["尾款"].ToString();
            //开票进度
            //DataTable wkpdt = pl.SqlBind("select COUNT(*) as zs,SUM(订单金额) as 订单金额 from v_DDB where 开票='未开'");
            //lblWkpje.Text = wkpdt.Rows[0]["订单金额"].ToString();
            //kppl = (100 - (Convert.ToInt32(wkpdt.Rows[0]["zs"]) / Convert.ToDouble(dt.Rows[0]["zs"])) * 100).ToString("0.00") + "%";
            //divKPPL.Style.Value = "width: " + kppl;
            ////已开未回
            //DataTable yjwhdt = pl.SqlBind("select COUNT(*) as zs,SUM(开票金额) as 开票金额,SUM(尾款) as 尾款 from [v_DDB] where 开票='已开'");
            //double ywk = Convert.ToDouble(yjwhdt.Rows[0]["尾款"]);
            //double ykpje = Convert.ToDouble(yjwhdt.Rows[0]["开票金额"].ToString());
            //lblyjwh.Text = yjwhdt.Rows[0]["尾款"].ToString();
            //hfykpwh.Value = (100 - (ywk / ykpje) * 100).ToString("0.00");
            ////当前年销售情况
            //DataTable dqdt = pl.SqlBind("select sum(订单金额) as 订单金额,sum(尾款) as 尾款  from v_DDB where 年份='" + DateTime.Now.Year.ToString() + "'");
            //double dwk = Convert.ToDouble(dqdt.Rows[0]["尾款"]);
            //double ddw = Convert.ToDouble(dqdt.Rows[0]["订单金额"].ToString());
            //lbldnxs.Text = dqdt.Rows[0]["订单金额"].ToString();
            //dnhk = (100 - (dwk / ddw) * 100).ToString("0.00") + "%";
            //divDNBL.Style.Value = "width: " + dnhk;
        }
    }
}